<!doctype html>
<html lang="en" translate="no">
  <head>
    <meta charset="UTF-8" />
    <link rel="icon" type="image/png" href="/icons/57x57.png" />
    
    <!-- 优化移动端视口设置 -->
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no,viewport-fit=cover" />
    
    <!-- 移动端浏览器优化 -->
    <meta name="format-detection" content="telephone=no,email=no,address=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-touch-fullscreen" content="yes" />
    <meta name="mobile-web-app-capable" content="yes" />
    
    <!-- 防止页面缓存 -->
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    
    <!-- 图标设置 -->
    <link rel="apple-touch-icon" sizes="57x57" href="/icons/57x57.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/icons/72x72.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/icons/114x114.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/icons/144x144.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/icons/180x180.png">
    
    <title>TikTok online store</title>
    <link rel="manifest" id="my-manifest" >
    
    <!-- 添加基础样式防止FOUC -->
    <style>
      * {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -moz-user-select: none;
             user-select: none;
      }
      
      html, body {
        margin: 0;
        padding: 0;
        height: 100%;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        background-color: #fff;
      }
      
      #app {
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100);
      }
      
      /* 防止iOS Safari底部工具栏遮挡 */
      @supports (padding: max(0px)) {
        #app {
          padding-bottom: max(0px, env(safe-area-inset-bottom));
        }
      }
    </style>
    
    <script type="module" crossorigin src="/assets/index-pJ50ReDo.js"></script>
    <link rel="stylesheet" crossorigin href="/assets/index-0fFNbxfL.css">
  </head>
  <body>
    <div id="app"></div>
    
    <script>
      !(function (n, e) {
        function setViewHeight() {
          var windowVH = e.innerHeight / 100
          n.documentElement.style.setProperty('--vh', windowVH + 'px')
          
          // 针对不同浏览器的特殊处理
          if (window.browserInfo) {
            if (window.browserInfo.isIOS && window.browserInfo.isSafari) {
              // iOS Safari 特殊处理
              setTimeout(() => {
                var actualVH = e.innerHeight / 100
                n.documentElement.style.setProperty('--vh', actualVH + 'px')
              }, 100);
            }
          }
        }
        
        // 防抖函数
        function debounce(func, wait) {
          let timeout;
          return function executedFunction(...args) {
            const later = () => {
              clearTimeout(timeout);
              func(...args);
            };
            clearTimeout(timeout);
            timeout = setTimeout(later, wait);
          };
        }
        
        const debouncedSetViewHeight = debounce(setViewHeight, 100);
        
        var resizeEvent = 'orientationchange' in window ? 'orientationchange' : 'resize'
        
        n.addEventListener('DOMContentLoaded', setViewHeight)
        e.addEventListener(resizeEvent, debouncedSetViewHeight)
        
        // 监听页面可见性变化
        document.addEventListener('visibilitychange', function() {
          if (!document.hidden) {
            setTimeout(setViewHeight, 100);
          }
        });
        
        // iOS 设备特殊处理
        if (window.browserInfo && window.browserInfo.isIOS) {
          e.addEventListener('focusin', function() {
            setTimeout(setViewHeight, 300);
          });
          
          e.addEventListener('focusout', function() {
            setTimeout(setViewHeight, 300);
          });
        }
        
        // 防止双击缩放
        let lastTouchEnd = 0;
        document.addEventListener('touchend', function (event) {
          const now = (new Date()).getTime();
          if (now - lastTouchEnd <= 300) {
            event.preventDefault();
          }
          lastTouchEnd = now;
        }, false);
        
      })(document, window)
      
      // 页面加载完成后的额外处理
      window.addEventListener('load', function() {
        // 隐藏地址栏（仅在某些移动浏览器中有效）
        setTimeout(function() {
          window.scrollTo(0, 1);
        }, 0);
      });
    </script>
  <script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon='{"version":"2024.11.0","token":"a39c6c52e1d04f239133072964553ce5","r":1,"server_timing":{"name":{"cfCacheStatus":true,"cfEdge":true,"cfExtPri":true,"cfL4":true,"cfOrigin":true,"cfSpeedBrain":true},"location_startswith":null}}' crossorigin="anonymous"></script>
</body>
  <script>
    // 全屏相关处理
    function requestFullscreen() {
      const element = document.documentElement;
      if (element.requestFullscreen) {
        element.requestFullscreen();
      } else if (element.webkitRequestFullscreen) {
        element.webkitRequestFullscreen();
      } else if (element.mozRequestFullScreen) {
        element.mozRequestFullScreen();
      } else if (element.msRequestFullscreen) {
        element.msRequestFullscreen();
      }
    }
    
    // 检测PWA模式
    function isPWA() {
      return (window.matchMedia('(display-mode: fullscreen)').matches ||
              window.matchMedia('(display-mode: standalone)').matches ||
              window.navigator.standalone === true);
    }
    
    // PWA安装后的处理
    if (isPWA()) {
      console.log('Running in PWA mode');
      document.body.classList.add('pwa-mode');
      
      // 隐藏地址栏
      window.addEventListener('load', function() {
        setTimeout(function() {
          window.scrollTo(0, 1);
        }, 100);
      });
    }
    
    // 监听安装事件
    let deferredPrompt;
    window.addEventListener('beforeinstallprompt', (e) => {
      e.preventDefault();
      deferredPrompt = e;
    });
    
    window.addEventListener('appinstalled', (evt) => {
      console.log('PWA was installed');
    });
  </script>
  
</html>
